<%@ page import="custom.*, java.util.*" %>

<html>
  <head>
    <title>Country of citizenship</title>
  </head>
  <body>
    <%
       session.removeAttribute("degrees");
       session.removeAttribute("street");
       session.removeAttribute("city");
       session.removeAttribute("state");
       session.removeAttribute("ctc");
       session.removeAttribute("zip");
       session.removeAttribute("area");
       session.removeAttribute("phone");

       // get and store name
       String firstName = request.getParameter("firstname");
       String middleName = request.getParameter("middlename");
       String lastName = request.getParameter("lastname");
       session.setAttribute("firstName", firstName);
       session.setAttribute("middleName", middleName);
       session.setAttribute("lastName", lastName);

       Vector countries= support.getCountries();
    %>
    First Name: <%= firstName %>
    <br>
    Middle Initial: <%= middleName %>
    <br>
    Last Name: <%= lastName %>
    <br><br>
    Please select your country of citizenship:
    <br>
    <!-- display all countires in a 3-column format -->
    <table>
    <%
    for(int i=1;i<countries.size(); i++) {
    	if(i%3==1) {
    		if(i!=1) {
    			%></tr><%
    		}
    		%><tr><%
    	}
    	%><td><a href="residence.jsp?ccid=<%= i %>"><%= countries.get(i) %></a></td>
    <%}
	%>
	</tr>
	</table>
  </body>
</html>
